var initEventTab = function() {
		YEvent.delegate("eventListTable", "click", viewEvent, '.view-event-link');
		YEvent.delegate("eventListTable", "click", deleteEvent, '.delete-event-link');
		
};
	
var viewEvent = function(event) {
	
	// 'this' refers to element that was clicked
	var parentRow = getParentRow(this);
	// Make xhr call get entity details
	var id = parentRow.readAttribute("eventId");
	getTabContent("event/edit?eventId="+id);
	
};




var createNewEvent = function() {
	goToTab("EVENT");
	getTabContent("event/add");
		
};

var returnToEventList = function() {
	getTabContent("events");
};


var deleteEvent = function(event){
	
	
	if (confirm("Are you want to delete?")) {
		// 'this' refers to element that was clicked
		var parentRow = getParentRow(this);
		// Make xhr call get entity details
		var id = parentRow.readAttribute("eventId");
		getTabContent("event/delete?eventId="+id);
	} else {
		return false;
	}
};